home *** CD-ROM | disk | FTP | other *** search
- unit PGroup;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- DBTables, DREng, StdCtrls, DRList;
-
- type
- TFormPrintGroup = class(TForm)
- DuckReport: TDuckReport;
- Memo1: TMemo;
- BPreview: TButton;
- procedure BPreviewClick(Sender: TObject);
- procedure DuckReportBeforePrintGroup(Sender: TObject; Canvas: TCanvas;
- RcPaper, RcGroup: TRect; SectionStyle: TDRSectionStyle;
- StField: String);
- private
- clColor: TColor;
- public
- { Public declarations }
- end;
-
- var
- FormPrintGroup: TFormPrintGroup;
-
- implementation
-
- {$R *.DFM}
- Procedure TFormPrintGroup.BPreviewClick(Sender: TObject);
- Begin
- clColor := clWhite;
- DuckReport.OpenFile;
- DuckReport.OpenDB;
- DuckReport.Preview;
- End;
- Procedure TFormPrintGroup.DuckReportBeforePrintGroup(Sender: TObject;
- Canvas: TCanvas; RcPaper, RcGroup: TRect; SectionStyle: TDRSectionStyle;
- StField: String);
- Begin
- if SectionStyle <> gtDetial Then Exit;
- Canvas.Brush.Color := clColor;
- Canvas.FillRect (RcGroup);
- if clColor = clWhite Then
- clColor := clSilver
- Else
- clColor := clWhite;
- End;
-
- End.
-